# Maintainer: Ariadne Conill <ariadne@dereferenced.org>
pkgname=milkytracker
pkgver=1.04.00
pkgrel=2
pkgdesc="music tracker inspired by fast tracker 2"
url="https://milkytracker.titandemo.org/"
arch="all"
license="GPL-3.0-or-later"
makedepends="
	alsa-lib-dev
	cmake
	rtmidi-dev
	samurai
	sdl2-dev
	zziplib-dev
	"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver-1.tar.gz::https://github.com/milkytracker/MilkyTracker/archive/refs/tags/v$pkgver.tar.gz
	fix-crash.patch
	"
builddir="$srcdir/MilkyTracker-$pkgver"
options="!check" # no testsuite

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr
	cmake --build build
}

check() {
	ctest --test-dir build --output-on-failure
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
247ff5daacb45b9445262917ab6c5e3b2309756d4e2a8317f4fd1fddefb49e97359122362ca0d8c5e3676661a45e2c559dd5a1e2cd7193d916a645f626ff32e7  milkytracker-1.04.00-1.tar.gz
9142846f031067c6327ae06cb77ac9a2be5d3e743b9ffc5f8f7e5ff12b48bd0d483c552401f476ef79edfb640cc2bd32353587fd9710e556eb3f1af0aae8024a  fix-crash.patch
"
